{% extends 'trp/base.html'%}
{% block content %}
<!-- 通用首页 -->
<div class="homebox mediachart">
	<div class="pageheader">
	    <h3>报表</h3>
	    <div class="daterangebox pull-left" style="margin-right:40px;">
	        <input type="text" name="reservation" class="daterangebox-ipt" value="" placeholder="按日期模糊搜索" readonly />
	        <a class="daterangebox-btn" href="javascript:;">日期</a>
	    </div>
	    <div class="dropbox pull-left">
		    <select name="type" style="width:150px;" placeholder="按媒体类型搜索">
				<option value="">全部媒体</option>
				<option value="1">站外</option>
				<option value="0">站内</option>
				<option value="2">联盟</option>
			</select>
	    </div>
	</div>
	<div class="chartbox">
		<div id="mediaChart" class="chart"></div>
		<div class="datatype">
			<label><input type="radio" name="datatype" value="pv" checked="checked">&nbsp;曝光量</label>
			<label><input type="radio" name="datatype" value="uv">&nbsp;独立访客量</label>
			<label><input type="radio" name="datatype" value="click">&nbsp;点击量</label>
			<label><input type="radio" name="datatype" value="ctr">&nbsp;点击转化率</label>
			{% ifequal user.account.get_organization.type 0 %}
				{% if  user.account.is_admin %}
				<!-- 平台管理员 -->
				<label><input type="radio" name="datatype" value="cost">&nbsp;媒体花费</label>
				<label><input type="radio" name="datatype" value="bid">&nbsp;竞价收入</label>
				<label><input type="radio" name="datatype" value="sale_income">&nbsp;预售收入</label>
				<label><input type="radio" name="datatype" value="profit">&nbsp;净收益</label>
				{%endif%}
				{% ifequal  user.account.is_admin  False %}
				<!-- 平台运营人员 -->
				{%endifequal%}
			{%endifequal%}
			{% ifnotequal user.account.get_organization.type 0 %}
				<!-- 小商铺和供应商 -->
				<label><input type="radio" name="datatype" value="cost">&nbsp;竞价花费</label>
				<label><input type="radio" name="datatype" value="sale_income">&nbsp;预售花费</label>
			{%endifnotequal%}
			
		</div>
	</div>
	
  <!--   管理员：总曝光量、日均曝光量、总点击量、日均点击量、总竞价收入、日均竞价收入；
  平台运营：总曝光量、日均曝光量、总点击量、日均点击量
  商铺运营：总曝光量、日均曝光量、总点击量、日均点击量、总竞价花费、 -->
	
	<div class="infobox">
		<div class="title">最近七日业务表现</div>
		<table>
			<tr class="normal">
				<th width="120">总曝光量</th>
				<td>{{total.pv}}</td>
			</tr>
			<tr class="normal">
				<th >日均曝光量</th>
				<td>{{total.pv_per_day|floatformat:0}}</td>
			</tr>
			<tr class="normal">
				<th >总点击量</th>
				<td>{{total.click}}</td>
			</tr>
			<tr class="normal">
				<th>日均点击量</th>
				<td>{{total.click_per_day|floatformat:0}}
			</tr>
			{% if user.account.is_admin%}
			<tr class="normal">
				<th>总竞价收入</th>
				<td>{{total.cost|floatformat:2}}</td>
			</tr>
			<tr class="normal">
				<th>日均竞价收入</th>
				<td>{{total.cost_per_day|floatformat:2}}</td>
			</tr>
			<tr class="normal">
				<th>总预售收入</th>
				<td>{{total.sale|floatformat:2}}</td>
			</tr>
			<tr class="normal">
				<th>日均预售收入</th>
				<td>{{total.sale_per_day|floatformat:2}}</td>
			</tr>
			{% endif %}
			
			{% ifnotequal user.account.get_organization.type 0 %}
			<tr class="normal">
				<th>总竞价花费</th>
				<td>{{total.cost|floatformat:2}}</td>
			</tr>
			<tr class="normal">
				<th>日均竞价花费</th>
				<td>{{total.cost_per_day|floatformat:2}}</td>
			</tr>
			<tr class="normal">
				<th>总预售花费</th>
				<td>{{total.sale|floatformat:2}}</td>
			</tr>
			<tr class="normal">
				<th>日均预售花费</th>
				<td>{{total.sale_per_day|floatformat:2}}</td>
			</tr>
			{%endifnotequal%}
			
		</table>
	</div>
</div>
<!-- <div class="homebox financechart">
	<div class="pageheader">
	    <h3 style="display:inline-block;">财务报表</h3>
	    <div class="daterangebox" style="margin-right:40px;">
	        <input type="text" name="reservation" class="daterangebox-ipt" value="2014-01-04 至 2014-06-11" readonly />
	        <a class="daterangebox-btn" href="javascript:;">日期</a>
	    </div>
	</div>
	<div id="financeChart" class="chart"></div>
	<div class="infobox">
		<div class="title">提醒</div>
		<ul>
			<li>***广告日均流量下滑明显</li>
			<li>***广告竞价情况较差</li>
			<li>***广告日均流量下滑明显</li>
			<li>***广告竞价情况较差</li>
			<li>***广告日均流量下滑明显</li>
			<li>***广告竞价情况较差</li>
		</ul>
	</div>
</div> -->
<script>seajs.use('trp/js/home');</script>
{% endblock %}